// import VXETable from 'vxe-table';
import vcolorpicker from 'vcolorpicker'

// base library
import {
  ConfigProvider,
  Layout,
  Input,
  InputNumber,
  Button as AButton,
  Switch,
  Radio,
  Checkbox,
  Select,
  Card,
  Form,
  Row,
  Col,
  Modal,
  Table,
  Tabs,
  Icon,
  Badge,
  Popover,
  Dropdown,
  List,
  Avatar,
  Breadcrumb,
  Steps,
  Spin,
  Menu,
  Drawer,
  Tooltip,
  Alert,
  Tag,
  Divider,
  DatePicker,
  TimePicker,
  Upload,
  Progress,
  Skeleton,
  Popconfirm,
  PageHeader,
  Result,
  Statistic,
  Descriptions,
  message,
  notification,
  TreeSelect,
  Pagination,
  Empty,
  Cascader,
  Collapse,
  Slider,
  Space,
  Affix,
  Tree,
  Timeline,
} from 'ant-design-vue'
// ext library
import VueCropper from 'vue-cropper'
import Dialog from '@/components/Dialog'
import MultiTab from '@/components/MultiTab'
import PageLoading from '@/components/PageLoading'
import ProLayout, { PageHeaderWrapper } from '../layouts/ProLayout'
import { Button } from './Button'
const AButtonGroup = AButton.Group
export function registerGlobComp(app: any) {
  app.use(ConfigProvider)
  app.component('pro-layout', ProLayout)
  app.component('page-header-wrapper', PageHeaderWrapper)
  app.use(Layout)
  app.use(Input)
  app.use(InputNumber)
  app.use(Button)
  app.component('a-button-group', AButtonGroup)
  app.use(Switch)
  app.use(Radio)
  app.use(Checkbox)
  app.use(Select)
  app.use(Card)
  app.use(Form)
  app.use(Row)
  app.use(Col)
  app.use(Modal)
  app.use(Table)
  app.use(Tabs)
  app.use(Icon)
  app.use(Badge)
  app.use(Popover)
  app.use(Dropdown)
  app.use(List)
  app.use(Avatar)
  app.use(Breadcrumb)
  app.use(Steps)
  app.use(Spin)
  app.use(Menu)
  app.use(Drawer)
  app.use(Tooltip)
  app.use(Alert)
  app.use(Tag)
  app.use(Divider)
  app.use(DatePicker)
  app.use(TimePicker)
  app.use(Timeline)
  app.use(Upload)
  app.use(Progress)
  app.use(Skeleton)
  app.use(Popconfirm)
  app.use(PageHeader)
  app.use(Result)
  app.use(Statistic)
  app.use(Descriptions)
  app.use(TreeSelect)
  app.use(Collapse)
  app.use(Slider)
  app.use(Space)
  app.use(Affix)
  app.use(Tree)
  // app.use(Viser)
  app.use(Dialog) // this.$dialog func
  app.use(MultiTab)
  app.use(PageLoading)
  // app.use(PermissionHelper)
  app.use(VueCropper)

  app.use(Pagination)
  app.use(Empty)
  app.use(Cascader)

  // 其他全局组件
  app.use(vcolorpicker)

  // 注册全局的提示模态
  app.prototype.$confirm = Modal.confirm
  app.prototype.$message = message
  app.prototype.$notification = notification
  app.prototype.$info = Modal.info
  app.prototype.$success = Modal.success
  app.prototype.$error = Modal.error
  app.prototype.$warning = Modal.warning
}
